home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / games2 / rotise12.zip / RDB.H < prev    next >
C/C++ Source or Header  |  1992-04-03  |  4KB  |  114 lines

  1. #ifndef H_RDB                                    /* Allow multiple inclusions */
  2. #define H_RDB
  3.  
  4. #include "bb_pdb.h"
  5.  
  6. /* some flags and such */
  7.  
  8. /* which kind of league */
  9. #define AL 0
  10. #define NL 1
  11. #define XL 2                                    /* Both/Neither league */
  12.  
  13. /* player data line argument list */
  14. #define ARG_SLOT 0                            /* slot name */
  15. #define ARG_NK1 (ARG_SLOT+1)                /* Name key 1 */
  16. #define ARG_NK2 (ARG_NK1+1)                /* Name key 2 */
  17. #define ARG_TEAM (ARG_NK2+1)                /* Team abbrev */                
  18. #define ARG_SAL  (ARG_TEAM+1)                /* salary */
  19. #define ARG_CONT (ARG_SAL+1)                /* contract */
  20. #define ARG_WF (ARG_CONT+1)                /* first week */
  21. #define ARG_WL (ARG_WF+1)                    /* last week */
  22. #define ARG_NAMES (ARG_WL+1)                /* name string */
  23.  
  24. /* contract status */
  25. #define CONT_1 0x0001                        /* First year */
  26. #define CONT_2 0x0002                        /* Second year */
  27. #define CONT_OPT 0x0004                        /* Option year */
  28. #define CONT_YR 0x0008                        /* Long term contract */
  29. #define CONT_YRM 0xff00                        /* # years left mask */
  30. #define CONT_YRSH 8                            /* right shift to get @ years */
  31.  
  32. /* Indexes into the rankings array */
  33. #define    RANK_AVG 0
  34. #define    RANK_HR    (RANK_AVG +1)
  35. #define    RANK_RBI (RANK_HR +1)
  36. #define    RANK_SB (RANK_RBI +1)
  37. #define    RANK_WINS (RANK_SB +1)
  38. #define    RANK_SVS (RANK_WINS +1)
  39. #define    RANK_ERA (RANK_SVS +1)
  40. #define    RANK_RATIO (RANK_ERA +1)
  41. #define    RANKSIZE (RANK_RATIO +1)
  42.  
  43. /* The arguments to build player */
  44. #define ARG_ADD_CMD     0
  45. #define ARG_ADD_RT    1                        /* Roto team key */
  46. #define ARG_ADD_PK1    2                        /* Player key1 */
  47. #define ARG_ADD_PK2    3                        /* Player key, part 2 */
  48. #define ARG_ADD_SLOT 4                        /* Already defined slot - 2 letters */
  49. #define ARG_ADD_SAL    5                        /* Salary, in salary units */
  50. #define ARG_ADD_CONT    6                        /* Contract - one letter */
  51. #define ARG_ADD_NAME    7                        /* Start of name */
  52.  
  53. /* Values for status */
  54. #define    STATUS_ACTIVE 0                    /* On active roster */
  55. #define    STATUS_RESERVE 1                    /* On reserve list */
  56. #define    STATUS_OLD 2                        /* Old player's stats */
  57. #define    STATUS_MINORS 3                    /* On minor league reserves */
  58.  
  59. /* max chars in the various names */
  60. #define MAX_LEAGUESIZE 40                    /* League name */
  61. #define MAX_TEAMSIZE 40                        /* Rotisserie team owner name */
  62. #define MAX_NAMESIZE 40                        /* Full Player name */
  63. #define MAX_OWNERSIZE 40                    /* Owner's name */
  64. #define MAX_SLOT 3                            /* Max Size of slot string */
  65.  
  66. /* settings for the weird field: zorch */
  67. #define PLAYER_UNAVAILABLE    -1                /* Not really available */
  68. #define PLAYER_FREE            0                /* Free agent */
  69. #define PLAYER_CLAIMED        1                /* On a rotise team */
  70. #define PLAYER_HIDDEN        2                /* Hidden off free agent list */
  71.  
  72. #define WAIVED_STRING "WAIV"                /* Status string for waived players */
  73.  
  74. typedef struct _rdb_slot {                    /* Info about a slot */
  75.     char    slot[MAX_SLOT +1];                /* Slot name */
  76.     UWORD    pos;                                    /* Positional information */
  77. } RDB_SLOT;
  78.  
  79. typedef struct _rdb_player {                /* Player data */
  80.     char name[MAX_NAMESIZE+1];                /* Player's name */
  81.     PDB_PNAME pname;                            /* players key name */
  82.     char slot;                                    /* Slot # as defined in slot list */
  83.     int salary;                                    /* salary units in salary */
  84.     UWORD contract;                            /* Contract status */
  85.     int start;                                    /* first week on team */
  86.     int end;                                        /* last week */
  87.     int status;                                    /* Status of player vis-a-vis this team */
  88.     struct _rdb_player *next;                /* pointer to next player in list */
  89. } RDB_PLAYER;
  90.  
  91. typedef struct _rdb_team {
  92.     char key[5];                                /* 4 letter max key word */
  93.     char name[MAX_TEAMSIZE];                /* Team name */
  94.     char owner[MAX_OWNERSIZE];                /* Owner(s) name */
  95.     RDB_PLAYER *players;                        /* players on team */
  96.  
  97.     PDBT_BATTER batters;                        /* tally batter's stats */
  98.     PDBT_BATTER bweek;                        /* weekly batter's stats */
  99.     PDBT_BATTER oldb;                            /* old batter's stats */
  100.  
  101.     PDBT_PITCHER pitchers;                    /* tally pitcher stats */
  102.     PDBT_PITCHER pweek;                        /* weekly pitcher stats */
  103.     PDBT_PITCHER oldp;                        /* old pitcher's stats */
  104.  
  105.     float points[RANKSIZE];                    /* save rotise points */
  106.     float totalPnts;                            /* final tally of points */
  107.  
  108.     int money_spent;                            /* amount spent, in salunits */
  109.  
  110.     struct _rdb_team *next;                    /* Pointer to next rotisserie team */
  111. } RDB_TEAM;
  112.  
  113. #endif
  114.